var authMgr = {
	setCookie: function(name, value, hour) {
		if(isNaN(hour) || hour < 0) {
			hour = 0;
		}
		var exp = new Date();
		exp.setTime(exp.getTime() + hour * 60 * 60 * 1000);
		document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString() + ";path=/";
	},
	getCookie: function(name, value, hour) {
		var argKey = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
		if(arr = document.cookie.match(argKey))
			return unescape(arr[2]);
		else
			return null;
	},
	delCookie: function(name) {
		var exp = new Date();
		exp.setTime(exp.getTime() - 10000);
		var cval = authMgr.getCookie(name);
		if(cval != null)
			document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString() + ";path=/";

	}

}